package com.geek.boot.controller;

import com.geek.boot.entity.User;
import com.geek.boot.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenmin
 * @desc TODO
 * @date 2025/9/7
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("{id}")
    public User findById(@PathVariable ("id") Integer id) {
        User user = userService.getById(id);
        return user;
    }
}
